#include<bits/stdc++.h>
#include<ext/pb_ds/assoc_container.hpp>
#include<ext/pb_ds/tree_policy.hpp>
#include<ext/rope>
#define rep(i,l,r) for(int i=(l),i##end=(r);i<=i##end;++i)
#define per(i,r,l) for(int i=(r),i##end=(l);i>=i##end;--i)
#define ll long long
#define int ll
#define double long double
#define pii pair<int,int>
#define fi first
#define se second
#define pb push_back
#define popcnt __builtin_popcount
#define rbtree(way) tree<way,null_type,less<way>,rb_tree_tag,tree_order_statistics_node_update>
using namespace std;
using namespace __gnu_cxx;
using namespace __gnu_pbds;
const int maxn=1e6+10,maxm=1e6+10,mod=998244353,inf=INT_MAX;
inline int ksm(int x,int k,int mod=mod){
	int ans=1;
	for(x%=mod;k;k>>=1,x=x*x%mod) if(k&1) ans=ans*x%mod;
	return ans;
}

int n,m,f[maxn],fa[maxn],dep[maxn],t[maxn],id[maxn];
int q,a[maxn],st,dp[maxn],st1,sn1[maxn];
pii sn[maxn];
vector<int> e[maxn];
int find(int x){return f[x]==x?x:f[x]=find(f[x]);}

void dfs(int x){
	for(int i:e[x]) if(i!=fa[x]) dep[i]=dep[x]+1,fa[i]=x,dfs(i);
}
void link(int x,int y){
	if(x==y) return;
	if(dep[x]<dep[y]) swap(x,y);
	t[x]^=1,link(fa[x],y);
}

void up(int nw,int x){
//	cout<<nw<<"]";
	if(t[nw]) t[nw]=0,up(fa[nw],x);
	else if(dp[nw]) sn[++st]={dp[nw],x},dp[nw]=0;
	else dp[nw]=x;
}
void solve(int x,int y){
	if(x==y) sn1[++st1]=x;
	else if(dep[x]<dep[y]) solve(x,fa[y]),sn1[++st1]=y;
	else sn1[++st1]=x,solve(fa[x],y);
}

signed main(){
	freopen("travel.in","r",stdin),freopen("travel.out","w",stdout);
	ios::sync_with_stdio(0),cin.tie(0),cout.tie(0);
	cin>>n>>m>>q;
	rep(i,1,n) f[i]=i,id[i]=i;
	rep(i,1,m){
		int u,v;
		cin>>u>>v;
		if(find(u)!=find(v)) f[f[u]]=f[v],e[u].pb(v),e[v].pb(u);
	}
	rep(i,1,n) if(find(i)==i) dep[i]=1,dfs(i);
	rep(i,1,q) cin>>a[i];
	sort(a+1,a+q+1,[&](int x,int y){return f[x]<f[y];});
	int lst=0,ans=0;
	rep(i,1,q) if(!lst) lst=a[i];
	else link(lst,a[i]),lst=0;
	sort(id+1,id+n+1,[&](int x,int y){return dep[x]>dep[y];});
//	rep(i,1,n) cout<<fa[i]<<",\n"[i==iend];
	rep(i,1,n) if(t[id[i]]) up(id[i],id[i]);
	rep(i,1,n) if(dp[i]) sn[++st]={i,dp[i]};
	cout<<st<<'\n';
	rep(i,1,st){
		st1=0,solve(sn[i].fi,sn[i].se),cout<<st1<<' ';
		rep(j,1,st1) cout<<sn1[j]<<' ';
		cout<<'\n';
	}
	return 0;
}
